{include file="public/header" /}
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <!-- Panel Other -->
    <div class="ibox float-e-margins">
        <div class="ibox-title">
            <h5>公共配置中心</h5>
        </div>
        <div class="ibox-content">
            <!--搜索框开始-->
            <div class="row">
                <div class="col-sm-12">
                    <div  class="col-sm-2" style="width: 100px">
                        <div class="input-group" >
                            <a href="{:url('add')}"><button class="btn btn-outline btn-primary" type="button">添加</button></a>
                        </div>
                    </div>
                    <form name="admin_list_sea" id="searchForm" class="form-search" method="post" action="{:url('index')}">
                        <div class="col-sm-3">
                            <div class="input-group">
                                <input type="text" id="key" class="form-control" name="dictionary_code" value="{$dictionary_code|default=''}" placeholder="输入需查询的联系方式" />
                                <span class="input-group-btn">
                                    <button type="submit" class="btn btn-primary"><i class="fa fa-search"></i> 搜索</button>
                                </span>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
            <!--搜索框结束-->
            <div class="hr-line-dashed"></div>

            <div class="example-wrap">
                <div class="example">
                    <table class="table table-bordered table-hover">
                        <thead>
                        <tr class="long-tr">
                            <!--<th>ID</th>-->
                            <th>配置枚举名称</th>
                            <th>配置枚举编号</th>
                            <th>键值对key</th>
                            <th>键值对value</th>
                            <th>对应键值对的描述</th>
                            <th>排序</th>
                            <th>更新时间</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody id="list-content">
                        {foreach $list as $vo}
                        <tr class="long-td">
                            <!--<td>{$vo["id"]}</td>-->
                            <td>{$vo["dictionary_name"]}</td>
                            <td>{$vo["dictionary_code"]}</td>
                            <td>{$vo["key"]}</td>
                            <td>{$vo["value"]}</td>
                            <td>{$vo["desc"]}</td>
                            <td>{$vo["sort"]}</td>
                            <td>{$vo["update_time"]}</td>
                            <td>
                                <a href="{:url('edit',['id'=>$vo['id']])}" class="btn btn-primary btn-xs">
                                    <i class="fa fa-paste"></i> 编辑</a>&nbsp;&nbsp;
                                <a href="{:url('delete',['id'=>$vo['id']])}" class="btn btn-danger btn-xs">
                                    <i class="fa fa-trash-o"></i> 删除</a>
                            </td>
                        </tr>
                        {/foreach}
                        </tbody>
                    </table>
                    <div id="laypage">
                        {$list->render()}
                    </div>
                </div>
            </div>
            <!-- End Example Pagination -->
        </div>
    </div>
</div>
<!-- End Panel Other -->
</div>

{include file="public/footer" /}
<script type="text/javascript" src="/static/admin/js/laypage.js"></script>
<script type="text/javascript">
    layer.photos({
        photos: '.layer-photos-demo'
//  ,anim: 5 //0-6的选择，指定弹出图片动画类型，默认随机（请注意，3.0之前的版本用shift参数）
    });

    layui.use(['laypage', 'layer'], function(){
        var laypage = layui.laypage
            ,layer = layui.layer;

        //完整功能
        laypage.render({
            elem: 'laypage'
            ,count: '{$list->total()}' // 总数据条数
            ,curr: '{$list->currentPage()}' // 当前第几页
            ,limit: '{$list->listRows()}'   // 每页显示条数
            ,layout: ['count', 'prev', 'page', 'next', 'refresh', 'skip']
            ,jump: function(obj, first){
                //首次不执行
                if(!first){
                    $("#searchForm").attr('action', '{:url("index")}?page='+obj.curr);
                    $("#searchForm").submit();
                }
            }
        });
    });
</script>
</body>
</html>